package com.example.demo.app.service.impl;

import com.example.demo.app.repository.CourseRepository;
import com.example.demo.app.service.CourseService;
import com.example.demo.domain.entity.Course;
import com.example.demo.infra.mapper.CourseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseServiceImpl implements CourseService {
    @Autowired
    private CourseRepository courseRepository;
    @Override
    public Course queryCourseById(Integer id) {
        return courseRepository.queryCourseById(id);
    }

    @Override
    public List<Course> queryCourseList() {
        return courseRepository.queryCourseList();
    }

    @Override
    public Integer addCourse(Course course) {
        return courseRepository.addCourse(course);
    }

    @Override
    public Integer saveCourse(Course course) {
        return courseRepository.saveCourse(course);
    }

    @Override
    public Integer deleteCourseById(Integer id) {
        return courseRepository.deleteCourseById(id);
    }
}
